import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Order from '../views/Order.vue'
import Find from '../views/Find.vue'
import Add from '../views/Add.vue'
import Edit from '../views/Edit.vue'


Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'Home',
		component: Home,
		children: [{
				path: '/home',
				name: 'Main',
				component: () => import('../views/Main.vue')
			},
			{
				path: '/home/shopcart',
				name: 'ShopCart',
				component: () => import('../views/ShopCart.vue')
			},
			{
				path: '/home/order',
				name: 'Order',
				component: () => import('../views/Order.vue')
			},
			{
				path: '/home/mine',
				name: 'Mine',
				component: () => import('../views/Mine.vue'),
				children: [{
					path: '/home/mine/newaddress',
					name: 'Newaddress',
					component: () => import('../views/Newaddress.vue')
				}]
			},
		]
	},
	{
		path: '/about',
		name: 'About',
		component: () => import('../views/About.vue')
	},
	{
		path: '/login',
		name: 'Login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/register',
		name: 'Register',
		component: () => import('../views/Register.vue')
	},
	{
		path: '/find',
		name: 'Find',
		component: () => import('../views/Find.vue')
	},
	{
		path: '/add',
		name: 'Add',
		component: () => import('../views/Add.vue')
	},
	{
		path: '/edit',
		name: 'Edit',
		component: () => import('../views/Edit.vue')
	},

]

const router = new VueRouter({
	routes
})

export default router
